demo_file = open('demo.txt', 'a')
contents = demo_file.write('hello world')
demo_file.close()

open